package nature.nano.component.part;

import java.util.ArrayList;
import java.util.List;

import nature.nano.iface.Accepter;
import nature.nano.iface.Props;

public class Combiner implements Accepter {

	private List<Accepter> accepters = new ArrayList<Accepter>();
	
	public Combiner(Accepter...accepters) {
		add(accepters);
	}
	
	public void add(Accepter...accepters) {
		for (Accepter accepter : accepters) {
			this.accepters.add(accepter);
		}
	}
	
	@Override
	public void onBegin(String type, Props props) {
		for (Accepter accepter : accepters) {
			accepter.onBegin(type, props);
		}
	}

	@Override
	public void onContent(String content) {
		for (Accepter accepter : accepters) {
			accepter.onContent(content);
		}
	}

	@Override
	public void onEnd(String type) {
		for (Accepter accepter : accepters) {
			accepter.onEnd(type);
		}
	}

}
